package com.ruoyi.use.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.use.vo.ExamUseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.use.mapper.ExaminationUseMapper;
import com.ruoyi.use.domain.ExaminationUse;
import com.ruoyi.use.service.IExaminationUseService;
import com.ruoyi.common.core.text.Convert;

/**
 * 使用记录Service业务层处理
 * 
 * @author mqs
 * @date 2024-05-03
 */
@Service
public class ExaminationUseServiceImpl implements IExaminationUseService 
{
    @Autowired
    private ExaminationUseMapper examinationUseMapper;

    /**
     * 查询使用记录
     *
     * @param examId 使用记录主键
     * @return 使用记录
     */


    @Override
    public ExamUseVO selectExaminationUseByExamId(Long examId) {
        return examinationUseMapper.selectExaminationUseByExamId(examId);
    }

    /**
     * 查询使用记录列表
     *
     * @param examUseVO 使用记录
     * @return 使用记录
     */
    @Override
    public List<ExamUseVO> selectExaminationUseList(ExamUseVO examUseVO) {
        return examinationUseMapper.selectExaminationUseList(examUseVO);
    }

    @Override
    public List<ExamUseVO> selectExamUseList(ExamUseVO examUseVO) {
        return examinationUseMapper.selectExamUseList(examUseVO);
    }


    /**
     * 新增使用记录
     * 
     * @param examinationUse 使用记录
     * @return 结果
     */
    @Override
    public int insertExaminationUse(ExaminationUse examinationUse)
    {
        examinationUse.setCreateTime(DateUtils.getNowDate());
        return examinationUseMapper.insertExaminationUse(examinationUse);
    }

    /**
     * 修改使用记录
     * 
     * @param examinationUse 使用记录
     * @return 结果
     */
    @Override
    public int updateExaminationUse(ExaminationUse examinationUse)
    {
        examinationUse.setUpdateTime(DateUtils.getNowDate());
        return examinationUseMapper.updateExaminationUse(examinationUse);
    }

    /**
     * 批量删除使用记录
     * 
     * @param examIds 需要删除的使用记录主键
     * @return 结果
     */
    @Override
    public int deleteExaminationUseByExamIds(String examIds)
    {
        return examinationUseMapper.deleteExaminationUseByExamIds(Convert.toStrArray(examIds));
    }

    /**
     * 删除使用记录信息
     * 
     * @param examId 使用记录主键
     * @return 结果
     */
    @Override
    public int deleteExaminationUseByExamId(Long examId)
    {
        return examinationUseMapper.deleteExaminationUseByExamId(examId);
    }
}
